<template>
  <div class="wrapper">
      <img class="img" src="../../assets/logos.png" alt="">
    <van-form @submit="onSubmit" class="form">
      <van-field
        v-model="login.mobile"
        name="用户名"
        placeholder="请输入手机号"
        :rules="[{ required: true, message: '请填写手机号' }]" />
      <van-field
        v-model="login.password"
        type="password"
        name="密码"
        placeholder="请输入密码"
        :rules="[{ required: true, message: '请填写密码' }]" />
        <div class="lz_login">
            <div class="lz_login">
                <router-link to="/mima" tag="div" class="lz_login_left">找回密码</router-link>
                <div class="lz_login_right">
                    <router-link to="/register" tap="span">注册/</router-link>
                    <router-link to="/register" tap="span">验证码登录</router-link>
                </div>
            </div>
        </div>
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit">
          登录
        </van-button>
      </div>
    </van-form>
  </div>
</template>

<script>
import { lzlogin } from "../../utils/http";
export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
      login: {
        mobile: "19801237380",
        password: "",
        type: 1,
        client:1,
      },
    };
  },
  mounted() {
  },
  methods: {
    async onSubmit(values) {
      console.log(values)
      const res = await lzlogin(this.login);
      // console.log(res);
       sessionStorage.setItem('userInfo',JSON.stringify(res))
       localStorage.setItem('adminToken',res.remember_token)
      this.$router.push('/mine')
    },
  },
  computed: {},
  watch: {},
  created() {},
};
</script>

<style scoped>
	
.wrapper{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items:center;
}
.form{
    width: 80%;
}
.van-field{
    border-bottom: 1px solid #ccc;
}
.lz_login{
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    color:#ccc;
}
.lz_zhuce{
  display: flex;
  justify-content: space-between;
  color:#ccc;
  margin-top: 10px;
}
.router-link{
  color:#ccc;
}
.van-button{
  background: #FF8247;
  border:none;
}
.img{
  width: 80%;
  margin: 13.3333vw auto;
}
</style>
